<%@page pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@taglib prefix="f" uri="http://www.slim3.org/functions"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="${ f:url('/admin/admin.css') }" />
<title>Dashboard</title>
</head>
<body>
<div id="wrap">
	<div id="side">
        <jsp:include page="menu.jsp"></jsp:include>
	</div>
	<div id="main">
		<div id="content">
			<h1>リンク</h1>

			<jsp:include page="message.jsp"></jsp:include>
			<form action="${ f:url('./linkPost') }" method="post">

			<table>
			    <tr>
                    <th>ラベル</th>
                    <th>URL</th>
                    <th>並び順</th>
			    </tr>
<c:forEach var="link" items="${ list }">
                <tr>
                    <td>
                        <input type="hidden" name="key" value="${ link.keyAsString }" />
                        <input type="text" name="label" value="${ link.label }" />
                    </td>
                    <td>
                        <input type="text" name="url" value="${ link.url }" size="50" />
                    </td>
                    <td>
                        <input type="text" name="sortOrder" value="${ link.sortOrder }" size="3" />
                    </td>
                </tr>
</c:forEach>
<c:forEach var="i" begin="0" end="2">
				<tr>
					<td>
					    <input type="hidden" name="key" value="" />
						<input type="text" name="label" />
					</td>
					<td>
						<input type="text" name="url" size="50" />
					</td>
                    <td>
                        <input type="text" name="sortOrder" size="3" />
                    </td>
				</tr>
</c:forEach>
			</table>
            
            <input type="submit" value="保存" />
            </form>
		</div>
	</div>
	<div id="footer">
	</div>
</div>
</body>
</html>
